package com.ruoyi.mx.service.impl;

import com.ruoyi.mx.domain.MxActivity;
import com.ruoyi.mx.dto.ActivityDetail;
import com.ruoyi.mx.mapper.MxActivityMapper;
import com.ruoyi.mx.service.IMxActivityService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.ArrayList;


/**
 * 美秀活动Service业务层处理
 *
 * @author ruoyi
 * @date 2021-09-27
 */
@Service
public class MxActivityServiceImpl extends ServiceImpl<MxActivityMapper, MxActivity> implements IMxActivityService {

    @Override
    public ArrayList<MxActivity> getSwiperActivity() {
        return baseMapper.getSwiperActivity();
    }

    @Override
    public ArrayList<MxActivity> getActivityList(Integer pageNum, Integer pageSize) {
        //limit 0,5从第0条数据开始取出5条  5,5从第五条数据开始再取出5条
        return baseMapper.getActivityList((pageNum-1)*pageSize,pageSize);
    }

    @Override
    public ActivityDetail getDetailById(String id) {
        return baseMapper.getDetailById(id);
    }

    @Override
    public ArrayList<MxActivity> getHotActivityList(Integer pageNum, Integer pageSize) {
        return baseMapper.getHotActivityList((pageNum-1)*pageSize,pageSize);
    }

    @Override
    public void insertCollections(String aid, String uid) {
        baseMapper.insertCollections(aid, uid);
    }

    @Override
    public Integer delCollections(String aid, String uid) {
        return baseMapper.delCollections(aid,uid);
    }


    @Override
    public void insertAZan(String aid, String uid) {
        baseMapper.insertAZan(aid,uid);
    }

    @Override
    public Integer delZan(String aid, String uid) {
        return baseMapper.delZan(aid,uid);
    }


    @Override
    public void insertACai(String aid, String uid) {
        baseMapper.insertACai(aid,uid);
    }

    @Override
    public Integer delCai(String aid, String uid) {
        return baseMapper.delCai(aid,uid);
    }

    @Override
    public Integer countCollections(String aid, String uid) {
        return baseMapper.countCollections(aid,uid);
    }

    @Override
    public Integer countActivityZan(String aid, String uid) {
        return baseMapper.countActivityZan(aid,uid);
    }

    @Override
    public Integer countActivityCai(String aid, String id) {
        return baseMapper.countActivityCai(aid,id);
    }

}
